package smb.util;

import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;

public class FileItem {

	private String name;
	private String path;
	private int size;
	private FileType fileType;

	public FileItem() {
		super();
	}

	public FileItem(SmbFile smb) throws SmbException {
		setName(smb.getName());
		setSize(smb.getContentLength());
		setPath(smb.getPath());
		setFileType(smb.isDirectory() ? FileType.Folder : FileType.File);
	}

	public FileItem(String name, String path, int size, FileType fileType) {
		super();
		this.name = name;
		this.path = path;
		this.size = size;
		this.fileType = fileType;
	}

	public String getName() {
		return name;
	}

	public FileItem setName(String name) {
		this.name = name;
		return this;
	}

	public String getPath() {
		return path;
	}

	public FileItem setPath(String path) {
		this.path = path;
		return this;
	}

	public int getSize() {
		return size;
	}

	public FileItem setSize(int size) {
		this.size = size;
		return this;
	}

	public FileType getFileType() {
		return fileType;
	}

	public FileItem setFileType(FileType fileType) {
		this.fileType = fileType;
		return this;
	}

}
